<?php
/**
 * Created by PhpStorm.
 * User: simon qin
 * Date: 2016/4/29
 * Time: 10:10
 */

function db_connect(){
    try{
        $result=mysql_connect("localhost","root","123456") ;
        mysql_select_db("testdb") ;
    } catch(Exception $e)  {
         echo $e->getMessage();
         exit();
    }
    if(!$result){
        return false;
    }
    return true;
}
